<?php
/**
 * User: shutao
 * @var View $this
 */

use yii\web\View;

$this->title = '模板变量列表';
?>
<div ng-controller="varIndexCtrl">
    <div class="xblock">
        <button class="layui-btn layui-btn-xs" ng-click="toEdit(0)">
            <i class="layui-icon">&#xe654;</i> 添加变量
        </button>

        <button class="layui-btn layui-btn-normal layui-btn-xs"
                onclick="openInLayer('wechat/var/system',this)"
        >系统内置变量</button>
        <span class="x-right">共有数据：<span><span ng-bind="pagination.itemsCount">0</span> 条</span></span>
    </div>

    <table class="layui-table">
        <tr>
            <th style="width: 150px;">变量名</th>
            <th>绑定值</th>
            <th style="width: 60px;">操作</th>
        </tr>

        <tr ng-repeat="x in datas">
            <td><span ng-bind="x.name"></span></td>
            <td><span ng-bind="x.value"></span></td>
            <td>
                <button ng-click="toEdit(x,$index)" title="编辑"
                        class="layui-btn layui-btn-xs layui-btn-warm"><i class="layui-icon">&#xe642;</i>
                </button>
                <button ng-click="toDelete(x,$index)" title="删除"
                        class="layui-btn layui-btn-xs layui-btn-danger"><i class="layui-icon">&#xe640;</i>
                </button>
            </td>
        </tr>
    </table>
    <div pagination="pagination" class="pagination"></div>
</div>
<input name="_csrf" type="hidden" id="_csrf" value="<?= \Yii::$app->request->csrfToken ?>">